<template>
    <div>
      <el-row>
        <el-col class="hhh">
          <span>维修工单工作台&nbsp;&nbsp;</span>
            <router-link :to="'maintenance'">
              <span style="color: #7c7c7c">进入工单列表 </span><br/>
            </router-link>
          <hr style="color: #828cad"/>
        </el-col>
      </el-row>
      <el-row>
        <el-tabs type="border-card" style="color: red;font-size: 18px">
          <el-tab-pane label="待检测">
            <small class="text-muted font-13">共{{a}}条</small>
            <el-table :data="a2" style="width: 100%">
              <el-table-column prop="maiId" label="ID" wsortable></el-table-column>
              <el-table-column label="工单主题" prop="maiNo">
              </el-table-column>
              <el-table-column label="对应客户" prop="customerByCustomerId.customerName" >
              </el-table-column>
              <el-table-column prop="maiProductName" label="维修产品" ></el-table-column>
              <el-table-column prop="maiCost" label="费用" ></el-table-column>
              <el-table-column prop="maiReceivable" label="已收款" ></el-table-column>
              <el-table-column prop="employeeByEmpId.empName"  label="接单人" ></el-table-column>
            </el-table>
          </el-tab-pane>
          <el-tab-pane label="待与客户确认维修">
            <small class="text-muted font-13">共{{b}}条</small>
            <el-table :data="b2" style="width: 100%">
              <el-table-column prop="maiId" label="ID" wsortable></el-table-column>
              <el-table-column label="工单主题" prop="maiNo">
              </el-table-column>
              <el-table-column label="对应客户" prop="customerByCustomerId.customerName" >
              </el-table-column>
              <el-table-column prop="maiProductName" label="维修产品" ></el-table-column>
              <el-table-column prop="maiCost" label="费用" ></el-table-column>
              <el-table-column prop="maiReceivable" label="已收款" ></el-table-column>
              <el-table-column prop="employeeByEmpId.empName"  label="接单人" ></el-table-column>
            </el-table>
          </el-tab-pane>
          <el-tab-pane label="待与客户沟通">
            <small class="text-muted font-13">共{{c}}条</small>
            <el-table :data="c2" style="width: 100%">
              <el-table-column prop="maiId" label="ID" wsortable></el-table-column>
              <el-table-column label="工单主题" prop="maiNo">
              </el-table-column>
              <el-table-column label="对应客户" prop="customerByCustomerId.customerName" >
              </el-table-column>
              <el-table-column prop="maiProductName" label="维修产品" ></el-table-column>
              <el-table-column prop="maiCost" label="费用" ></el-table-column>
              <el-table-column prop="maiReceivable" label="已收款" ></el-table-column>
              <el-table-column prop="employeeByEmpId.empName"  label="接单人" ></el-table-column>
            </el-table>
          </el-tab-pane>
          <el-tab-pane label="待维修">
            <small class="text-muted font-13">共{{d}}条</small>
            <el-table :data="d2" style="width: 100%">
              <el-table-column prop="maiId" label="ID" wsortable></el-table-column>
              <el-table-column label="工单主题" prop="maiNo">
              </el-table-column>
              <el-table-column label="对应客户" prop="customerByCustomerId.customerName" >
              </el-table-column>
              <el-table-column prop="maiProductName" label="维修产品" ></el-table-column>
              <el-table-column prop="maiCost" label="费用" ></el-table-column>
              <el-table-column prop="maiReceivable" label="已收款" ></el-table-column>
              <el-table-column prop="employeeByEmpId.empName"  label="接单人" ></el-table-column>
            </el-table>
          </el-tab-pane>
          <el-tab-pane label="维修中">
            <small class="text-muted font-13">共{{e}}条</small>
            <el-table :data="e2" style="width: 100%">
              <el-table-column prop="maiId" label="ID" wsortable></el-table-column>
              <el-table-column label="工单主题" prop="maiNo">
              </el-table-column>
              <el-table-column label="对应客户" prop="customerByCustomerId.customerName" >
              </el-table-column>
              <el-table-column prop="maiProductName" label="维修产品" ></el-table-column>
              <el-table-column prop="maiCost" label="费用" ></el-table-column>
              <el-table-column prop="maiReceivable" label="已收款" ></el-table-column>
              <el-table-column prop="employeeByEmpId.empName"  label="接单人" ></el-table-column>
            </el-table>
          </el-tab-pane>
          <el-tab-pane label="待通知与客户交付">
            <small class="text-muted font-13">共{{f}}条</small>
            <el-table :data="f2" style="width: 100%">
              <el-table-column prop="maiId" label="ID" wsortable></el-table-column>
              <el-table-column label="工单主题" prop="maiNo">
              </el-table-column>
              <el-table-column label="对应客户" prop="customerByCustomerId.customerName" >
              </el-table-column>
              <el-table-column prop="maiProductName" label="维修产品" ></el-table-column>
              <el-table-column prop="maiCost" label="费用" ></el-table-column>
              <el-table-column prop="maiReceivable" label="已收款" ></el-table-column>
              <el-table-column prop="employeeByEmpId.empName"  label="接单人" ></el-table-column>
            </el-table>
          </el-tab-pane>
          <el-tab-pane label="未尽收款">
            <small class="text-muted font-13">共{{g}}条</small>
            <el-table :data="g2" style="width: 100%">
              <el-table-column prop="maiId" label="ID" wsortable></el-table-column>
              <el-table-column label="工单主题" prop="maiNo">
              </el-table-column>
              <el-table-column label="对应客户" prop="customerByCustomerId.customerName" >
              </el-table-column>
              <el-table-column prop="maiProductName" label="维修产品" ></el-table-column>
              <el-table-column prop="maiCost" label="费用" ></el-table-column>
              <el-table-column prop="maiReceivable" label="已收款" ></el-table-column>
              <el-table-column prop="employeeByEmpId.empName"  label="接单人" ></el-table-column>
            </el-table>
          </el-tab-pane>
        </el-tabs>
      </el-row>
    </div>
</template>

<script>
export default {
  data () {
    return {
      a: '',
      a2: [],
      b: '',
      b2: [],
      c: '',
      c2: [],
      d: '',
      d2: [],
      e: '',
      e2: [],
      f: '',
      f2: [],
      g: '',
      g2: []
    }
  },
  methods: {
    // 查询
    initData () {
      this.$axios.get('http://localhost:8088/maintenance-selectA')
        .then(v => {
          this.a = v.data.count
          this.a2 = v.data.rows
        })
        .catch(function (v) {
        })
    },
    initData2 () {
      this.$axios.get('http://localhost:8088/maintenance-selectB')
        .then(v => {
          this.b = v.data.count
          this.b2 = v.data.rows
        })
        .catch(function (v) {
        })
    },
    initData3 () {
      this.$axios.get('http://localhost:8088/maintenance-selectC')
        .then(v => {
          this.c = v.data.count
          this.c2 = v.data.rows
        })
        .catch(function (v) {
        })
    },
    initData4 () {
      this.$axios.get('http://localhost:8088/maintenance-selectD')
        .then(v => {
          this.d = v.data.count
          this.d2 = v.data.rows
        })
        .catch(function (v) {
        })
    },
    initData5 () {
      this.$axios.get('http://localhost:8088/maintenance-selectE')
        .then(v => {
          this.e = v.data.count
          this.e2 = v.data.rows
        })
        .catch(function (v) {
        })
    },
    initData6 () {
      this.$axios.get('http://localhost:8088/maintenance-selectF')
        .then(v => {
          this.f = v.data.count
          this.f2 = v.data.rows
        })
        .catch(function (v) {
        })
    },
    initData7 () {
      this.$axios.get('http://localhost:8088/maintenance-selectG')
        .then(v => {
          this.g = v.data.count
          this.g2 = v.data.rows
        })
        .catch(function (v) {
        })
    }
  },
  created () {
    this.initData()
    this.initData2()
    this.initData3()
    this.initData4()
    this.initData5()
    this.initData6()
    this.initData7()
  }
}
</script>

<style>
  .hh{
    font-size: 24px;
    color: white;
    padding-top: 5px;
    text-align: center;
    height: 200px;
    border-radius: 15px;
    margin-left: 40px;
    margin-top: 26px;
  }
  .hhh{
    font-size: 16px;
    font-weight: bolder;
  }
 /* .el-table{
    font-size: 18px;
    padding: 5px;
  }*/
</style>
